package Util;

/**
 * Created by liheng on 2019/1/22.
 */

public class StringUtil {
    static public String secTostr(long sec){
        if(sec<60){
            return String.valueOf(sec)+"秒";
        }else if(sec < 3600){
            return String.valueOf(sec/60)+"分"+String.valueOf(sec%60)+"秒";
        }else if(sec < 86400){
            return String.valueOf(sec/3600)+"时"+String.valueOf(sec%3600/60)+"分"+String.valueOf(sec%3600%60)+"秒";
        }else {
            return String.valueOf(sec/86400)+"天"+String.valueOf(sec%86400/3600)+"时"+String.valueOf(sec%86400%3600/60)+"分"+String.valueOf(sec%86400%3600%60)+"秒";
        }
    }
}
